export const layoutRoutes = [
  // 首页
  {
    path: '/home',
    component: () => import('@/views/Home/index.vue'),
    name: 'home',
    meta: {
      title: '首页'
    }
  },
  // 我的小窝
  {
    path: '/myhome',
    component: () => import('@/views/MyHome/index.vue'),
    name: 'myhome',
    meta: {
      title: '我的小窝'
    },
    redirect: { name: 'passages' }, // 这里使用name来进行重定向，更加清晰
    children: [
      {
        path: 'passages',
        component: () => import('@/views/MyHome/Passage/index.vue'),
        name: 'passages',
        meta: {
          title: '我的小窝 - 我的文章'
        }
      },
      {
        path: 'messageboard',
        component: () => import('@/views/MyHome/MessageBoard/index.vue'),
        name: 'messageboard',
        meta: {
          title: '我的小窝 - 留言板'
        }
      }
    ]
  },
  // 他人小窝
  {
    path: '/otherHome/:id',
    component: () => import('@/views/MyHome/index.vue'),
    name: 'otherhome',
    meta: {
      title: '他人小窝'
    },
    redirect: { name: 'otherPassages' }, // 新增重定向name
    children: [
      {
        path: '/otherHome/passages/:id',
        component: () => import('@/views/MyHome/Passage/index.vue'),
        name: 'otherPassages', // 修改name以区分
        meta: {
          title: '他人小窝 - 我的文章'
        }
      },
      {
        path: '/otherHome/messageboard/:id',
        component: () => import('@/views/MyHome/MessageBoard/index.vue'),
        name: 'otherMessageboard', // 修改name以区分
        meta: {
          title: '他人小窝 - 留言板'
        }
      }
    ]
  },
  // 文章列表
  {
    path: '/passage/:pathMatch(.*)*',
    component: () => import('@/views/List/index.vue'),
    name: 'passage',
    meta: {
      title: '文章列表'
    }
  },
  // 捐助我们
  {
    path: '/donate',
    component: () => import('@/views/Donate/index.vue'),
    name: 'donate',
    meta: {
      title: '捐助我们'
    }
  },
  //新建文章
  {
    path: '/newpassage',
    component: () => import('@/views/Edit/index.vue'),
    name: 'newpassage',
    meta: {
      title: '新建文章'
    }
  },
  //编辑文章
  {
    path: '/editpassage/:id',
    component: () => import('@/views/Edit/index.vue'),
    name: 'editpassage',
    meta: {
      title: '编辑文章'
    }
  },
  //浏览文章
  {
    path: '/viewpassage/:id',
    component: () => import('@/views/View/index.vue'),
    name: 'viewpassage',
    meta: {
      title: '浏览文章'
    }
  },
  //个人信息
  {
    path: '/myinfo',
    component: () => import('@/views/UserInfo/index.vue'),
    name: 'myinfo',
    meta: {
      title: '个人信息'
    },
    redirect: '/myinfo/personalInfo',
    children: [
      {
        path: '/myinfo/personalInfo',
        component: () => import('@/views/UserInfo/PersonalInfo.vue'),
        name: 'personalInfo',
        meta: {
          title: '个人信息 - 个人信息'
        }
      },
      {
        path: '/myinfo/accountInfo',
        component: () => import('@/views/UserInfo/AccountInfo.vue'),
        name: 'accountInfo',
        meta: {
          title: '个人信息 - 修改密码'
        }
      },
      {
        path: '/myinfo/deleteAccount',
        component: () => import('@/views/UserInfo/Delete.vue'),
        name: 'deleteAccount',
        meta: {
          title: '个人信息 - 注销用户'
        }
      },
    ]
  },
  // 我的好友
  {
    path: '/friends',
    component: () => import('@/views/Friends/index.vue'),
    name: 'friends',
    meta: {
      title: '我的好友'
    }
  }
]